<?php

/**
 * This file is part of the Pagizer package.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @copyright   Copyright (c) 2010 Advisa (http://www.advisa.fr)
 * @author      Pagizer Core Team <team@pagizer.org>
 * @package     pagizer
 * @subpackage  news
 */

class m_news_actions_block_front_NewsHighlightsEditAction extends m_backoffice_extends_BlockEditModal
{
	public function execute()
	{
		$blockParams = $this->getBlockContext()->getParameters();
        
        $website = $this->getContext('currentWebsite');

        $pages = m_website_services_PageService::getInstance()->searchPagesByBlockParameters(array('action'=>'front_News'), $blockParams["blockLang"], $website->getUniqueId());

        $folderId = isset($blockParams["folderId"]) ? $blockParams["folderId"] : null;

        $folders = m_backoffice_services_TreeService::getInstance()
							->getSelectArray($website->getUniqueId(), "modules_backoffice/folder", $folderId, false, true, 'news');

        $this->addToModel("pages", $pages);
        $this->addToModel("folders", $folders);
        $this->addToModel("blockParams", $blockParams);

		$this->setView('success');
	}
}